package com.smartleanx.module.hrm.controller.app.eagin;


import com.smartleanx.framework.common.pojo.CommonResult;
import com.smartleanx.module.hrm.service.esign.auth.IPsnAuthService;
import com.smartleanx.module.hrm.service.esign.bo.PsnAuthBo;
import com.smartleanx.module.hrm.service.esign.temp.vo.Auth.PsnAuthVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Tag(name =  "个人认证链接")
@RestController
@RequestMapping("/hrm/app/esign/auth")
public class ESignAuthAppController {

    @Autowired
    private IPsnAuthService psnAuthService;

    /**
     * 【通用】获取个人认证&授权页面链接

     *
     * @apiNote 身份信息：大陆身份证+身份证号
     *          默认认证方式：手机号三要素
     *          可选认证方式：手机号三要素、银行卡四要素，人脸
     *          授权范围：全部
     *          无重定向、无自定义回调通知
     */
    @ApiOperation("获取个人认证/授权链接，查询实名/授权信息")
    @PostMapping("/identify")
    public CommonResult<PsnAuthVo> psnIdentify(@RequestBody @Valid PsnAuthBo param) {
        return CommonResult.success(psnAuthService.getPsnAuthResult(param));
    }

    @GetMapping("/getStatus")
    public CommonResult<Object> getStatus() {
        return CommonResult.success(psnAuthService.getStatus());
    }







}
